<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<c:set var="htmlPath" value="${redis:getSysConfig('in_path_html')}"/>
<c:set var="defaultImg" value="${redis:getSysConfig('website_default_img')}"/>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shopjsp icon" href="${srcPath}/common/images/sj.ico"/>
    <title>ShopJsp商城平台运营管理系统</title>
    <!-- Bootstrap -->
    <link href="${srcPath}/3thParty/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="${srcPath}/3thParty/bootstrap_vendors/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <!-- Custom Theme Style -->
    <link href="${srcPath}/3thParty/bootstrap_vendors/build/css/custom.css" rel="stylesheet">
    <!-- jQuery -->
    <script src="${srcPath}/3thParty/jquery/js/jquery-2.0.3.min.js"></script>
    <style type="text/css"></style>
    <script type="text/javascript">
        /**
         * 刷新新的权限页面
         * @param purviewId
         */
        function gotoWorkSpace(purviewId){
            window.location.href="${basePath}/back/workspace/index.htm?purviewId="+purviewId;
        }

        /**
         * 控制子菜单选中效果
         * @param purviewId
         */
        function setChecked(id){
            $(".child_menu").find("li").removeAttr("class","active");
            $("#secli_"+id).attr("class","active");
        }
    </script>

</head>

<body class="nav-md" style="background: #2A3F54;">
    <div class="container body">
        <div class="main_container">
            <!-- 左侧部分start -->
            <div id="main_left" class="col-md-3 left_col">
                <div class="left_col scroll-view">
                    <div class="navbar nav_title" style="border: 0;">
                        <a href="#" class="site_title"><i class="fa fa-paw"></i> <span>军工人之家商城</span></a>
                    </div>

                    <div class="clearfix"></div>

                    <!-- 左侧头部管理员信息 start -->
                    <div class="profile clearfix">
                        <div class="profile_pic">
                            <img src="${uploadPath}/${userPhoto}" alt="..." class="img-circle profile_img">
                        </div>
                        <div class="profile_info">
                            <span>欢迎您!</span>
                            <h2>${userName}</h2>
                        </div>
                    </div>
                    <!-- 左侧头部管理员信息 end -->


                    <!-- 左侧中间菜单 start -->
                    <div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
                        <div class="menu_section">
                            <ul class="nav side-menu" id="leftPurview">
                               <c:forEach items="${purviews}" var="purview" varStatus="count">
                                   <li>
                                       <a><i class='fa fa-home'></i>${purview.purviewName}<span class='fa fa-chevron-down'></span></a>
                                       <ul class='nav child_menu'>
                                           <c:forEach items="${purview.basicPurviews}" var="subPurview" varStatus="subCount">
                                               <li id="secli_${subPurview.purviewId}" onclick="setChecked('${subPurview.purviewId}')">
                                                   <a href='${basePath}/${subPurview.url}?purviewId=${subPurview.purviewId}' target='rightFrame'>${subPurview.purviewName}</a>
                                               </li>
                                           </c:forEach>
                                       </ul>
                                   </li>
                               </c:forEach>
                            </ul>
                        </div>
                    </div>
                    <!-- 左侧中间菜单 end -->

                    <!-- 左侧底部按钮 start -->
                    <div class="sidebar-footer hidden-small">
                        <a data-toggle="tooltip" data-placement="top" title="设置">
                            <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
                        </a>
                        <a class="menu_toggle_first" data-toggle="tooltip" data-placement="top" title="全屏">
                            <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
                        </a>
                        <a data-toggle="tooltip" data-placement="top" title="锁屏" href="${basePath}/backLogin/index.htm">
                            <span class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
                        </a>
                        <a data-toggle="tooltip" data-placement="top" title="退出" href="${basePath}/backLogin/index.htm">
                            <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
                        </a>
                    </div>
                    <!-- 左侧底部按钮 end -->
                </div>
            </div>
            <!-- 左侧部分end -->

            <!-- 头部导航start -->
            <div class="top_nav">
                <div class="nav_menu"  id="main_top">
                    <nav>
                        <div class="nav toggle">
                            <a class="menu_toggle_first"><i class="fa fa-bars"></i></a>
                        </div>
                        <!-- 一级菜单 start -->
                        <c:forEach items="${basicPurviews}" var="list" varStatus="count">
                            <div class="nav toggle" >
                                <a data-toggle="tooltip" data-placement="bottom" title="${list.purviewName}" class="menu_toggle" onclick="gotoWorkSpace(${list.purviewId})"    class="${count.index==0 ? 'selected' : ''}">
                                    <img src="${uploadPath}/${list.iconUrl}"  width="30px" height="30px"/>
                                </a>
                                <div id="checked_${list.purviewId}"></div>
                            </div>
                        </c:forEach>
                        <!-- 一级菜单 end -->
                        <script type="text/javascript">
                            $(function () {
                                $("#checked_${checkedPurviewId}").css("border-bottom","5px solid #428bca").css("padding","10px 0px 0px 0px");
                            })
                        </script>

                        <ul class="nav navbar-nav navbar-right">
                            <li class="">
                                <a href="javascript:" class="user-profile dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
                                    <img src="${uploadPath}/${userPhoto}" alt="">${userName}
                                    <span class=" fa fa-angle-down"></span>
                                </a>
                                <ul class="dropdown-menu dropdown-usermenu pull-right">
                                    <li><a href="javascript:">帮助</a></li>
                                    <li><a href="${basePath}/backLogin/index.htm"><i class="fa fa-sign-out pull-right"></i> 退出</a></li>
                                </ul>
                            </li>

                           <%-- <li role="presentation" class="dropdown">
                                <a href="javascript:;" class="dropdown-toggle info-number" data-toggle="dropdown" aria-expanded="false">
                                    <i class="fa fa-envelope-o"></i>
                                    <span class="badge bg-green">1</span>
                                </a>
                                <ul id="menu1" class="dropdown-menu list-unstyled msg_list" role="menu">
                                    <li>
                                        <a>
                                            <span class="image"><img src="${srcPath}/3thParty/bootstrap_vendors/common/images/img.jpg" alt="Profile Image" /></span>
                                            <span>
                                              <span>张三</span>
                                              <span class="time">3 分钟前</span>
                                            </span>
                                            <span class="message">我这边有问题需要您帮忙！赶紧过来!!!! </span>
                                        </a>
                                    </li>

                                </ul>
                            </li>--%>

                        </ul>
                    </nav>
                </div>
            </div>
            <!-- 头部导航end -->

            <div class="right_col" role="main" id="right_col">
                <iframe id="main_right_iframe" onload="setFrameHeight()" src="${basePath}/back/workspace/welcome.htm" id="rightFrame"   name="rightFrame" width="100%" scrolling="yes" frameborder="0" marginheight="0" marginwidth="0">
                网站使用了框架技术，但是您的浏览器不支持框架，请升级您的浏览器以便正常访问。
                </iframe>
                <div style="background: #2A3F54;text-align: center;padding-top:2px; ">
                     <a style="color:#ECF5FF"  href="http://b2b2c.shopjsp.com">军工人之家商城后台管理系统</a>
                </div>
            </div>
            <!-- 右侧内容 end -->
            <%----%>

        </div>
    </div>
    <!-- 右侧内容 start -->
    <script type="text/javascript">
        function setFrameHeight(){
            var main_left_height=$("#main_left").height();
            var main_top_height=$("#main_top").height();
            var main_right_iframe_height=main_left_height-main_top_height-35;
            $("#main_right_iframe").height(main_right_iframe_height);
        }
    </script>
    <!-- Bootstrap -->
    <script src="${srcPath}/3thParty/bootstrap/js/bootstrap.min.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="${srcPath}/3thParty/bootstrap_vendors/build/js/custom.js"></script>

</body>
</html>


